<html>
<head><meta charset="utf-8"><title>how to trigger MIR inliner at will · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html">how to trigger MIR inliner at will</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="187268836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187268836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187268836">(Feb 03 2020 at 14:55)</a>:</h4>
<p>I'm trying to fix <a href="https://github.com/rust-lang/rust/issues/67586" target="_blank" title="https://github.com/rust-lang/rust/issues/67586">https://github.com/rust-lang/rust/issues/67586</a> and step 0 is to make a self-contained reproduction, presumably relying on MIR inlining</p>



<a name="187268863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187268863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187268863">(Feb 03 2020 at 14:55)</a>:</h4>
<p>but this doesn't do it <a href="https://godbolt.org/z/fgS-hj" target="_blank" title="https://godbolt.org/z/fgS-hj">https://godbolt.org/z/fgS-hj</a></p>



<a name="187268957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187268957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187268957">(Feb 03 2020 at 14:56)</a>:</h4>
<p>ftr, it's this snippet, using <code>-Zmir-opt-level=2 --emit=mir -Cdebuginfo=2</code>:</p>
<div class="codehilite"><pre><span></span><span class="cp">#[inline(always)]</span><span class="w"></span>
<span class="k">fn</span> <span class="nf">foo</span><span class="p">(</span><span class="n">x</span>: <span class="kt">usize</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kt">usize</span> <span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">x</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">bar</span><span class="p">(</span><span class="n">y</span>: <span class="kt">usize</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kt">usize</span> <span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">foo</span><span class="p">(</span><span class="n">y</span><span class="p">)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="187268973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187268973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187268973">(Feb 03 2020 at 14:56)</a>:</h4>
<p>this works for me locally</p>



<a name="187268983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187268983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187268983">(Feb 03 2020 at 14:56)</a>:</h4>
<p>even with <code>--emit=mir</code>?</p>



<a name="187268994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187268994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187268994">(Feb 03 2020 at 14:56)</a>:</h4>
<p>haven't tested</p>



<a name="187269006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269006">(Feb 03 2020 at 14:56)</a>:</h4>
<p>but with <code>-Zdump-mir=all</code> it is</p>
<div class="codehilite"><pre><span></span>// MIR for `foo`
// source = MirSource { instance: Item(DefId(0:3 ~ foo[8787]::foo[0])), promoted: None }
// pass_name = Inline
// disambiguator = before

fn  foo(_1: usize) -&gt; usize {
    debug x =&gt; _1;                       // in scope 0 at foo.rs:2:8: 2:9
    let mut _0: usize;                   // return place in scope 0 at foo.rs:2:21: 2:26

    bb0: {
        _0 = _1;                         // bb0[0]: scope 0 at foo.rs:3:5: 3:6
        return;                          // bb0[1]: scope 0 at foo.rs:4:2: 4:2
    }
}
</pre></div>



<a name="187269025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269025">(Feb 03 2020 at 14:57)</a>:</h4>
<p>hmm this is before inlining !?</p>



<a name="187269044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269044">(Feb 03 2020 at 14:57)</a>:</h4>
<p><code>bar</code> is the one that <code>foo</code> should get inlined into, you can ignore <code>foo</code></p>



<a name="187269053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269053">(Feb 03 2020 at 14:57)</a>:</h4>
<p>rofl</p>



<a name="187269055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269055">(Feb 03 2020 at 14:57)</a>:</h4>
<p>ups</p>



<a name="187269064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269064">(Feb 03 2020 at 14:57)</a>:</h4>
<p>ok, doesn't work either</p>



<a name="187269152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269152">(Feb 03 2020 at 14:58)</a>:</h4>
<p>I'm guessing the weight algorithm is broken for inline-always</p>



<a name="187269153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269153">(Feb 03 2020 at 14:58)</a>:</h4>
<p><span class="user-mention" data-user-id="125799">@andjo403</span> <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> do you know anything weird about that the inliner that could cause this?</p>



<a name="187269182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269182">(Feb 03 2020 at 14:58)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> I mean, it doesn't work without it or with just <code>#[inline]</code> either</p>



<a name="187269206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269206">(Feb 03 2020 at 14:59)</a>:</h4>
<p>I should go and read an inline mir-opt test, lol</p>



<a name="187269537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269537">(Feb 03 2020 at 15:02)</a>:</h4>
<p>you have to be kidding me... it's sensitive to the declaration order?!</p>



<a name="187269664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269664">(Feb 03 2020 at 15:04)</a>:</h4>
<p>this works <a href="https://godbolt.org/z/XerSJ8" target="_blank" title="https://godbolt.org/z/XerSJ8">https://godbolt.org/z/XerSJ8</a></p>



<a name="187269789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269789">(Feb 03 2020 at 15:05)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/c58e09f138075ce6b3079f41f9c2f192a15b896c/src/librustc_mir/transform/inline.rs#L112" target="_blank" title="https://github.com/rust-lang/rust/blob/c58e09f138075ce6b3079f41f9c2f192a15b896c/src/librustc_mir/transform/inline.rs#L112">https://github.com/rust-lang/rust/blob/c58e09f138075ce6b3079f41f9c2f192a15b896c/src/librustc_mir/transform/inline.rs#L112</a></p>



<a name="187269869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269869">(Feb 03 2020 at 15:06)</a>:</h4>
<p>this is so terrible Q_Q</p>



<a name="187269976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187269976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187269976">(Feb 03 2020 at 15:07)</a>:</h4>
<p>I should've just done this from the start: <a href="https://godbolt.org/z/6JP9oR" target="_blank" title="https://godbolt.org/z/6JP9oR">https://godbolt.org/z/6JP9oR</a></p>



<a name="187270041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187270041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187270041">(Feb 03 2020 at 15:08)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> how is that not a big issue perma-open until we find a real solution?</p>



<a name="187270132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187270132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187270132">(Feb 03 2020 at 15:09)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="n">debug</span><span class="w"> </span><span class="n">foo_arg</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="n">_1</span><span class="p">;</span><span class="w">                 </span><span class="c1">// in scope 0 at ./example.rs:1:12: 1:19</span>
<span class="w">    </span><span class="n">scope</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">debug</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="n">_1</span><span class="p">;</span><span class="w">                   </span><span class="c1">// in scope 1 at /rustc/9ed29b6ff6aa2e048b09c27af8f62ee3040bdb37/src/libcore/convert/mod.rs:106:26: 106:27</span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="187270160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187270160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187270160">(Feb 03 2020 at 15:09)</a>:</h4>
<p>this is what I was after, it does trigger a LLVM assertion, and it should be trivial to fix</p>



<a name="187276324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187276324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187276324">(Feb 03 2020 at 16:11)</a>:</h4>
<p>can I see what <code>rustc</code> invocations <code>compiletest</code> does?!</p>



<a name="187276614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187276614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187276614">(Feb 03 2020 at 16:14)</a>:</h4>
<p>Maybe <code>./x.py test -vvv</code> works?</p>



<a name="187276650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187276650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187276650">(Feb 03 2020 at 16:15)</a>:</h4>
<p>If the test fails, I'm pretty sure the test runner prints out the rustc arguments used</p>



<a name="187277438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187277438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187277438">(Feb 03 2020 at 16:22)</a>:</h4>
<p>the problem is it doesn't fail :(</p>



<a name="187277445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187277445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187277445">(Feb 03 2020 at 16:22)</a>:</h4>
<p>but thanks, I can add a syntax error</p>



<a name="187277858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187277858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187277858">(Feb 03 2020 at 16:26)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> nope, that just spams more in rustbuild, nothing extra from <code>compiletest</code> compared to <code>-vv</code></p>



<a name="187279321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187279321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187279321">(Feb 03 2020 at 16:40)</a>:</h4>
<p>ugh in a bin crate I can't force a function to be codegen'd without calling it from <code>main</code>, I really don't like the fragility there :/</p>



<a name="187279359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187279359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187279359">(Feb 03 2020 at 16:40)</a>:</h4>
<p>I'm not sure the context of what you're trying to do but I believe you can use <code>--emit mir</code> to force it</p>



<a name="187279376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187279376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187279376">(Feb 03 2020 at 16:41)</a>:</h4>
<p>But that might not work for what you're doing</p>



<a name="187279386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187279386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187279386">(Feb 03 2020 at 16:41)</a>:</h4>
<p>I need 1. MIR inlining 2. -C debuginfo=2 and 3. codegen to trigger this</p>



<a name="187279409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187279409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187279409">(Feb 03 2020 at 16:41)</a>:</h4>
<p>Ah, yeah that won't work then</p>



<a name="187279410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187279410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187279410">(Feb 03 2020 at 16:41)</a>:</h4>
<p>(it's a LLVM verification failure bug)</p>



<a name="187286694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/how%20to%20trigger%20MIR%20inliner%20at%20will/near/187286694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/how.20to.20trigger.20MIR.20inliner.20at.20will.html#187286694">(Feb 03 2020 at 17:58)</a>:</h4>
<p>btw this is the fix I was trying to test <a href="https://github.com/rust-lang/rust/pull/68802" target="_blank" title="https://github.com/rust-lang/rust/pull/68802">https://github.com/rust-lang/rust/pull/68802</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>